<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>添加链接图片</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="assets/outerRes/css/bootstrap.css">
    <link rel="stylesheet" href="assets/innerRes/css/commonParts.css">
    <link rel="stylesheet" href="assets/innerRes/css/addLinkImage.css">
</head>
<body>
<form action="positionImage/storeLinkImage.do" method="post" enctype="multipart/form-data" role="form" class="col-sm-4 col-sm-offset-4">
    <div class="form-group">
        <button id="targetCommodityChoose" type="button" class="btn btn-primary">目标商品选择</button>
        <div id="targetCommodityResult">未选择任何目标商品</div>
        <%--<div id="targetCommodityResult">--%>
            <%--<div class="cityLabel">北京</div>--%>
            <%--<img src="assets/innerRes/img/test/1.jpg"/>--%>
            <%--<div class="commodityName">水果拼盘</div>--%>
        <%--</div>--%>

        <div class="form-group">
            <label for="linkImage">链接图片</label>
            <input type="file" id="linkImage" name="linkImage">
        </div>

        <div class="form-group">
            <label for="imagePositionId">图片位置</label>
            <select class="form-control" id="imagePositionId" name="imagePositionId">
                <c:forEach items="${allPosition}" var="position">
                    <option value="${position.id}">${position.positionName}</option>
                </c:forEach>
            </select>
        </div>

        <div class="form-group">
            <label for="reasonDescription">添加原因描述</label>
            <textarea id="reasonDescription" name="reasonDescription" class="form-control" rows="3"></textarea>
        </div>

        <div class="form-group">
            <button type="submit" class="btn btn-default">提交</button>
            <button id="abandonAndReturn" type="submit" class="btn btn-default">放弃并返回</button>
        </div>
</form>

<!-- 模态框（Modal） -->
<div class="modal fade" id="targetCommodityList" tabindex="-1" role="dialog" aria-labelledby="targetCommodityListTitle"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="targetCommodityListTitle">商品列表</h4>
            </div>
            <div class="modal-body">
                <div class="container">
                    <div class="row">
                        <div class="col-md-2">
                            <select id="commodityTypeList">
                            </select>
                        </div>
                        <div class="col-md-2">
                            <select id="commodityStatusList">
                                <option value="1">已上架商品</option>
                                <option value="2">未上架商品</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div id="commodityListContainer">
                    <div>
                        <%--<div class="customRow">--%>
                        <%--<div class="commodityInfo">--%>
                        <%--<div class="cityLabel">北京</div>--%>
                        <%--<img src="assets/innerRes/img/test/1.jpg"/>--%>
                        <%--<div class="commodityName">水果拼盘</div>--%>
                        <%--<div>--%>
                        <%--<a type="button" class="btn btn-info">选择</a>--%>
                        <%--<a type="button" class="btn btn-info pull-right">查看详情</a>--%>
                        <%--<span commodityId="1" cityLabel="北京" commodityName="水果拼盘"--%>
                        <%--style="display:none"></span>--%>
                        <%--</div>--%>
                        <%--</div>--%>
                        <%--<div class="commodityInfo">--%>
                        <%--<div class="cityLabel">北京</div>--%>
                        <%--<img src="assets/innerRes/img/test/1.jpg"/>--%>
                        <%--<div class="commodityName">水果拼盘</div>--%>
                        <%--</div>--%>
                        <%--<div class="commodityInfo">--%>
                        <%--<div class="cityLabel">北京</div>--%>
                        <%--<img src="assets/innerRes/img/test/1.jpg"/>--%>
                        <%--<div class="commodityName">水果拼盘</div>--%>
                        <%--</div>--%>
                        <%--<div class="commodityInfo">--%>
                        <%--<div class="cityLabel">北京</div>--%>
                        <%--<img src="assets/innerRes/img/test/1.jpg"/>--%>
                        <%--<div class="commodityName">水果拼盘</div>--%>
                        <%--</div>--%>
                        <%--</div>--%>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>

<jsp:include page="/WEB-INF/commonJsp/commonParts.jsp"/>

<input id="basePath" type="hidden" value="<%=basePath%>"/>
<script src="assets/outerRes/js/jquery-3.0.0.js"></script>
<script src="assets/outerRes/js/bootstrap.js"></script>
<script src="assets/innerRes/js/addLinkImage.js"></script>

<script>
    $(function () {
        addLinkImage.init();
    });
</script>
</body>
</html>
